import Vue from 'vue'
import Vuex from 'vuex'

Vue.use(Vuex)

export default new Vuex.Store({
  state: {
    user: null
  },
  getters: {
  },
  mutations: {
    setUser(state, user) {
      state.user = user
    },
    clearUser(state) {
      state.user = null
    }
  },
  actions: {
    setUser(context, user) {
      context.commit('setUser', user)
    },
    clearUser(context) {
      context.commit('clearUser')
    }
  },
  modules: {
  }
})
